<template>
<div>
  <el-dialog
    :title="title"
    :close-on-click-modal="false"
     v-dialogDrag
    :visible.sync="visible">
    <el-form :model="inputForm" size="small" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
             label-width="140px">
      <el-row  :gutter="15">
        <!-- <el-col :span="12">
            <el-form-item label="用户名" prop="userName"
                :rules="[
                  {required: true, message:'用户名不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.userName" placeholder="请填写用户名"     ></el-input>
           </el-form-item>
        </el-col> -->
        <el-col :span="12">
            <el-form-item label="姓名" prop="realName"
                :rules="[
                  {required: true, message:'真实姓名不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.realName" placeholder="请填写真实姓名"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="密码" prop="passWord"
                :rules="[
                  {required: true, message:'密码不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.passWord" placeholder="请填写密码"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="学历" prop="education"
                :rules="[
                  {required: true, message:'学历不能为空', trigger:'blur'}
                 ]">
                <el-select v-model="inputForm.education" placeholder="请选择"  style="width: 100%;">
                          <el-option
                            v-for="item in $dictUtils.getDictList('nature')"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                          </el-option>
                      </el-select>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="户籍" prop="householdRegister"
                :rules="[
                  {required: true, message:'户籍不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.householdRegister" placeholder="请填写户籍"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="兴趣" prop="interest"
                :rules="[
                 ]">
              <el-input v-model="inputForm.interest" placeholder="请填写兴趣"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="驾照" prop="drivingLicense"
                :rules="[
                 ]">
                <el-select v-model="inputForm.drivingLicense" placeholder="请选择"  style="width: 100%;">
                          <el-option
                            v-for="item in $dictUtils.getDictList('driving_license')"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                          </el-option>
                      </el-select>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="部门" prop="department.id"
                :rules="[
                 ]">
          <GridSelect
            title="选择部门"
            labelName = 'name'
            labelValue = 'id'
            :value = "inputForm.department.id"
            :limit="1"
            @getValue='(value) => {inputForm.department.id=value}'
            :columns="[
            {
              prop: 'id',
              label: '主键'
            },
            {
              prop: 'name',
              label: '名称'
            }
            ]"
            :searchs="[
            {
              prop: 'id',
              label: '主键'
            },
            {
              prop: 'name',
              label: '名称'
            }
            ]"
            dataListUrl="/dlyrl/hr/orporateinstitutions/orporateInstitutions/list"
            entityBeanName="orporateInstitutions"
            queryEntityUrl="/dlyrl/hr/orporateinstitutions/orporateInstitutions/queryById">
          </GridSelect>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="分部" prop="branchdepart.id"
                :rules="[
                 ]">
          <GridSelect
            title="选择分部"
            labelName = 'name'
            labelValue = 'id'
            :value = "inputForm.branchdepart.id"
            :limit="1"
            @getValue='(value) => {inputForm.branchdepart.id=value}'
            :columns="[
            {
              prop: 'id',
              label: '主键'
            },
            {
              prop: 'name',
              label: '名称'
            }
            ]"
            :searchs="[
            {
              prop: 'id',
              label: '主键'
            },
            {
              prop: 'name',
              label: '名称'
            }
            ]"
            dataListUrl="/dlyrl/hr/orporateinstitutions/orporateInstitutions/list"
            entityBeanName="orporateInstitutions"
            queryEntityUrl="/dlyrl/hr/orporateinstitutions/orporateInstitutions/queryById">
          </GridSelect>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="岗位" prop="job"
                :rules="[
                 ]">
              <el-input v-model="inputForm.job" placeholder="请填写岗位"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="手机号" prop="phone"
                :rules="[
                  {required: true, message:'手机号不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.phone" placeholder="请填写手机号"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
          <!-- (0:在职 1:已解除合同 2:实习 3:转正 4:试用 5:临时) -->
            <el-form-item label="工作状态" prop="workCondition"
                :rules="[
                 ]">
                <el-select v-model="inputForm.workCondition" placeholder="请选择"  style="width: 100%;">
                          <el-option
                            v-for="item in $dictUtils.getDictList('work_status')"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                          </el-option>
                      </el-select>
           </el-form-item>
        </el-col>
        <el-col :span="12">
          <!-- (0为已认证,1为未认证,2为待审核)(实名认证) -->
            <el-form-item label="是否认证" prop="isApprove"
                :rules="[
                  {required: true, message:'是否认证不能为空', trigger:'blur'}
                 ]">
                <el-select v-model="inputForm.isApprove" placeholder="请选择"  style="width: 100%;">
                          <el-option
                            v-for="item in $dictUtils.getDictList('yes_no')"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                          </el-option>
                      </el-select>
           </el-form-item>
        </el-col>
        <el-col :span="12">
          <!-- （4已招聘(已签订合同) 5已经聘用未签订合同 6已离职(已解除劳动合同)  7无聘用关系） -->
            <el-form-item label="聘用状态" prop="employmentStatus"
                :rules="[
                  {required: true, message:'聘用状态不能为空', trigger:'blur'}
                 ]">
                <el-select v-model="inputForm.employmentStatus" placeholder="请选择"  style="width: 100%;">
                          <el-option
                            v-for="item in $dictUtils.getDictList('employment_status')"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                          </el-option>
                      </el-select>
           </el-form-item>
        </el-col>
        
        <el-col :span="12">
            <el-form-item label="等级评级" prop="gradeRatings"
                :rules="[
                  {required: true, message:'等级评级不能为空', trigger:'blur'}
                 ]">
                <el-select v-model="inputForm.gradeRatings" placeholder="请选择"  style="width: 100%;">
                          <el-option
                            v-for="item in $dictUtils.getDictList('grade_ratings')"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                          </el-option>
                      </el-select>
           </el-form-item>
        </el-col>
<!-- ---------------------------- -->
<el-col :span="12">
        <el-form-item prop="enterpriseInformation.id" label="签订合同企业">
          <GridSelect
            title="选择签订合同企业"
            labelName="companyName"
            labelValue="id"
            :value="inputForm.enterpriseInformation.id"
            :limit="1"
            size="small"
            @getValue="
              (value) => {
                inputForm.enterpriseInformation.id = value;
              }
            "
            :columns="[
              {
                prop: 'id',
                label: '主键',
              },
              {
                prop: 'companyName',
                label: '企业名称',
              },
            ]"
            :searchs="[
              {
                prop: 'id',
                label: '主键',
              },
              {
                prop: 'companyName',
                label: '企业名称',
              },
            ]"
            dataListUrl="/dlyrl/hr/enterpriseinformation/enterpriseInformation/list"
            entityBeanName="enterpriseInformation"
            queryEntityUrl="/dlyrl/hr/enterpriseinformation/enterpriseInformation/queryById"
          >
          </GridSelect>
        </el-form-item>
           </el-col>
           <el-col :span="12">
        <el-form-item prop="enterpriseInformation.id" label="工作企业">
          <GridSelect
            title="选择工作企业"
            labelName="companyName"
            labelValue="id"
            :value="inputForm.sendenterprise.id"
            :limit="1"
            size="small"
            @getValue="
              (value) => {
                inputForm.sendenterprise.id = value;
              }
            "
            :columns="[
              {
                prop: 'id',
                label: '主键',
              },
              {
                prop: 'companyName',
                label: '企业名称',
              },
            ]"
            :searchs="[
              {
                prop: 'id',
                label: '主键',
              },
              {
                prop: 'companyName',
                label: '企业名称',
              },
            ]"
            dataListUrl="/dlyrl/hr/enterpriseinformation/enterpriseInformation/list"
            entityBeanName="enterpriseInformation"
            queryEntityUrl="/dlyrl/hr/enterpriseinformation/enterpriseInformation/queryById"
          >
          </GridSelect>
        </el-form-item>
           </el-col>
<!-- --------------------------------- -->
        <el-col :span="12">
          <!-- (0是 1否) -->
            <el-form-item label="是否劳务派遣" prop="isDispatch"
                :rules="[
                 ]">
                <el-select v-model="inputForm.isDispatch" placeholder="请选择"  style="width: 100%;">
                          <el-option
                            v-for="item in $dictUtils.getDictList('yes_no')"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                          </el-option>
                      </el-select>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="所在地" prop="area"
                :rules="[
                  {required: true, message:'所在地不能为空', trigger:'blur'}
                 ]">
                      <CityPicker 
                         style="width:100%"
                        :value="inputForm.area"
                        :clearable="true" 
                        :accordion="true"
                        @getValue="(value) => {inputForm.area=value}"/>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="电子邮箱" prop="email"
                :rules="[
                  {required: true, message:'电子邮箱不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.email" placeholder="请填写电子邮箱"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="开户行" prop="openingbank"
                :rules="[
                  {required: true, message:'开户行不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.openingbank" placeholder="请填写开户行"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="行号" prop="banknumber"
                :rules="[
                 ]">
              <el-input v-model="inputForm.banknumber" placeholder="请填写行号"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="银行卡号" prop="bankcard"
                :rules="[
                  {required: true, message:'银行卡号不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.bankcard" placeholder="请填写银行卡号"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="身份证号" prop="idCard"
                :rules="[
                  {required: true, message:'身份证号不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.idCard" placeholder="请填写身份证号"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="身份证正面照片" prop="idCardFrond"
                :rules="[
                  {required: true, message:'身份证正面照片不能为空', trigger:'blur'}
                 ]">
              <el-upload ref="idCardFrond"
                    v-if="visible"
                    :action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/dlyrl/hr/userinformation/userInformation`"
                    :headers="{token: $cookie.get('token')}"
                    :on-preview="(file) => {$window.open ((file.response && file.response.url) || file.url,'_blank') }"
                    :on-success="(response, file, fileList) => {
                       inputForm.idCardFrond = fileList.map(item => (item.response && item.response.url) || item.url).join('|')
                    }"
                    :on-remove="(file, fileList) => {
                      $http.post(`/sys/file/webupload/deleteByUrl?url=${(file.response && file.response.url) || file.url}`).then(({data}) => {
                        $message.success(data.msg)
                      })
                      inputForm.idCardFrond = fileList.map(item => item.url).join('|')
                    }"
                    :before-remove="(file, fileList) => {
                      return $confirm(`确定移除 ${file.name}？`)
                    }"
                    multiple
                    :limit="5"
                    :on-exceed="(files, fileList) =>{
                      $message.warning(`当前限制选择 5 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`)
                    }"
                    :file-list="idCardFrondArra">
                    <el-button size="small" type="primary">点击上传</el-button>
                    <div slot="tip" class="el-upload__tip">添加相关附件</div>
                  </el-upload>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="身份证背面照片" prop="idCardBack"
                :rules="[
                  {required: true, message:'身份证背面照片不能为空', trigger:'blur'}
                 ]">
              <el-upload ref="idCardBack"
                    v-if="visible"
                    :action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/dlyrl/hr/userinformation/userInformation`"
                    :headers="{token: $cookie.get('token')}"
                    :on-preview="(file) => {$window.open ((file.response && file.response.url) || file.url,'_blank') }"
                    :on-success="(response, file, fileList) => {
                       inputForm.idCardBack = fileList.map(item => (item.response && item.response.url) || item.url).join('|')
                    }"
                    :on-remove="(file, fileList) => {
                      $http.post(`/sys/file/webupload/deleteByUrl?url=${(file.response && file.response.url) || file.url}`).then(({data}) => {
                        $message.success(data.msg)
                      })
                      inputForm.idCardBack = fileList.map(item => item.url).join('|')
                    }"
                    :before-remove="(file, fileList) => {
                      return $confirm(`确定移除 ${file.name}？`)
                    }"
                    multiple
                    :limit="5"
                    :on-exceed="(files, fileList) =>{
                      $message.warning(`当前限制选择 5 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`)
                    }"
                    :file-list="idCardBackArra">
                    <el-button size="small" type="primary">点击上传</el-button>
                    <div slot="tip" class="el-upload__tip">添加相关附件</div>
                  </el-upload>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="备注信息" prop="remarks"
                :rules="[
                 ]">
          <el-input type="textarea" v-model="inputForm.remarks" placeholder="请填写备注信息"     ></el-input>
           </el-form-item>
        </el-col>


        <!-- <el-col :span="12">
            <el-form-item label="性别" prop="sex"
                :rules="[
                  {required: true, message:'性别不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.sex" placeholder="请填写性别"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="年龄" prop="age"
                :rules="[
                  {required: true, message:'年龄不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.age" placeholder="请填写年龄"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="工作经验年限" prop="workingYears"
                :rules="[
                  {required: true, message:'工作经验年限不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.workingYears" placeholder="请填写工作经验年限"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="现住址" prop="currentAddress"
                :rules="[
                  {required: true, message:'现住址不能为空', trigger:'blur'}
                 ]">
                      <CityPicker 
                         style="width:100%"
                        :value="inputForm.currentAddress"
                        :clearable="true" 
                        :accordion="true"
                        @getValue="(value) => {inputForm.currentAddress=value}"/>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="毕业院校" prop="graduatedSchool"
                :rules="[
                  {required: true, message:'毕业院校不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.graduatedSchool" placeholder="请填写毕业院校"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="紧急联系人" prop="emergencyContact"
                :rules="[
                  {required: true, message:'紧急联系人不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.emergencyContact" placeholder="请填写紧急联系人"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="紧急联系人手机号" prop="emergencyContactPhone"
                :rules="[
                  {required: true, message:'紧急联系人手机号不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.emergencyContactPhone" placeholder="请填写紧急联系人手机号"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="现住地址" prop="address"
                :rules="[
                  {required: true, message:'现住地址不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.address" placeholder="请填写现住地址"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="认证状态" prop="attstatus"
                :rules="[
                  {required: true, message:'认证状态不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.attstatus" placeholder="请填写认证状态"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="参加工作时间" prop="plusJobsTime"
                :rules="[
                  {required: true, message:'参加工作时间不能为空', trigger:'blur'}
                 ]">
                <el-date-picker
                      style="width: 100%;"
                      v-model="inputForm.plusJobsTime"
                      type="datetime"
                      value-format="yyyy-MM-dd HH:mm:ss"
                      placeholder="选择日期时间">
                    </el-date-picker>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="员工编号" prop="numbering"
                :rules="[
                  {required: true, message:'员工编号不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.numbering" placeholder="请填写员工编号"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12"> -->
          <!-- (0鼎力相助，1灵活用工) -->
            <!-- <el-form-item label="注册来源" prop="loginRoot"
                :rules="[
                 ]">
                <el-select v-model="inputForm.loginRoot" placeholder="请选择"  style="width: 100%;">
                          <el-option
                            v-for="item in $dictUtils.getDictList('login_root')"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                          </el-option>
                      </el-select>
           </el-form-item>
        </el-col>
        
        <el-col :span="12">
            <el-form-item label="登录token" prop="token"
                :rules="[
                 ]">
              <el-input v-model="inputForm.token" placeholder="请填写登录token"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="融云用户id" prop="rongyunuserid"
                :rules="[
                 ]">
              <el-input v-model="inputForm.rongyunuserid" placeholder="请填写融云用户id"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="融云token" prop="rongyuntoken"
                :rules="[
                 ]">
              <el-input v-model="inputForm.rongyuntoken" placeholder="请填写融云token"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="沟通过" prop="communication"
                :rules="[
                 ]">
              <el-input v-model="inputForm.communication" placeholder="请填写沟通过"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="待面试" prop="interview"
                :rules="[
                 ]">
              <el-input v-model="inputForm.interview" placeholder="请填写待面试"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="收藏" prop="collect"
                :rules="[
                 ]">
              <el-input v-model="inputForm.collect" placeholder="请填写收藏"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="已投简历" prop="delivery"
                :rules="[
                 ]">
              <el-input v-model="inputForm.delivery" placeholder="请填写已投简历"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="高德个人终端id" prop="terminaId"
                :rules="[
                 ]">
              <el-input v-model="inputForm.terminaId" placeholder="请填写高德个人终端id"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="余额" prop="balance"
                :rules="[
                 ]">
              <el-input v-model="inputForm.balance" placeholder="请填写余额"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="支付密码" prop="paymentPassword"
                :rules="[
                 ]">
              <el-input v-model="inputForm.paymentPassword" placeholder="请填写支付密码"     ></el-input>
           </el-form-item>
        </el-col>
        
        <el-col :span="12">
            <el-form-item label="电话" prop="telePhone"
                :rules="[
                  {required: true, message:'电话不能为空', trigger:'blur'}
                 ]">
              <el-input v-model="inputForm.telePhone" placeholder="请填写电话"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="个体商户资格视频" prop="individualcertificationvideo"
                :rules="[
                 ]">
              <el-input v-model="inputForm.individualcertificationvideo" placeholder="请填写个体商户资格视频"     ></el-input>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="是否认证个体商户）" prop="ismerchantauthentication"
                :rules="[
                 ]">
                <el-select v-model="inputForm.ismerchantauthentication" placeholder="请选择"  style="width: 100%;">
                          <el-option
                            v-for="item in $dictUtils.getDictList('')"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                          </el-option>
                      </el-select>
           </el-form-item>
        </el-col> -->
        <!-- <el-col :span="12">
            <el-form-item label="头像" prop="headPortrait"
                :rules="[
                  {required: true, message:'头像不能为空', trigger:'blur'}
                 ]">
              <el-upload ref="headPortrait"
                    v-if="visible"
                    :action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/dlyrl/hr/userinformation/userInformation`"
                    :headers="{token: $cookie.get('token')}"
                    :on-preview="(file, fileList) => {$window.location.href = (file.response && file.response.url) || file.url}"
                    :on-success="(response, file, fileList) => {
                       inputForm.headPortrait = fileList.map(item => (item.response && item.response.url) || item.url).join('|')
                    }"
                    :on-remove="(file, fileList) => {
                      $http.post(`/sys/file/webupload/deleteByUrl?url=${(file.response && file.response.url) || file.url}`).then(({data}) => {
                        $message.success(data.msg)
                      })
                      inputForm.headPortrait = fileList.map(item => item.url).join('|')
                    }"
                    :before-remove="(file, fileList) => {
                      return $confirm(`确定移除 ${file.name}？`)
                    }"
                    multiple
                    :limit="5"
                    :on-exceed="(files, fileList) =>{
                      $message.warning(`当前限制选择 5 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`)
                    }"
                    :file-list="headPortraitArra">
                    <el-button size="small" type="primary">点击上传</el-button>
                    <div slot="tip" class="el-upload__tip">添加相关附件</div>
                  </el-upload>
           </el-form-item>
        </el-col> -->
        
        <!-- <el-col :span="12">
            <el-form-item label="个体商户资格证" prop="individualCertification"
                :rules="[
                  {required: true, message:'个体商户资格证不能为空', trigger:'blur'}
                 ]">
              <el-upload ref="individualCertification"
                    v-if="visible"
                    :action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/dlyrl/hr/userinformation/userInformation`"
                    :headers="{token: $cookie.get('token')}"
                    :on-preview="(file, fileList) => {$window.location.href = (file.response && file.response.url) || file.url}"
                    :on-success="(response, file, fileList) => {
                       inputForm.individualCertification = fileList.map(item => (item.response && item.response.url) || item.url).join('|')
                    }"
                    :on-remove="(file, fileList) => {
                      $http.post(`/sys/file/webupload/deleteByUrl?url=${(file.response && file.response.url) || file.url}`).then(({data}) => {
                        $message.success(data.msg)
                      })
                      inputForm.individualCertification = fileList.map(item => item.url).join('|')
                    }"
                    :before-remove="(file, fileList) => {
                      return $confirm(`确定移除 ${file.name}？`)
                    }"
                    multiple
                    :limit="5"
                    :on-exceed="(files, fileList) =>{
                      $message.warning(`当前限制选择 5 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`)
                    }"
                    :file-list="individualCertificationArra">
                    <el-button size="small" type="primary">点击上传</el-button>
                    <div slot="tip" class="el-upload__tip">添加相关附件</div>
                  </el-upload>
           </el-form-item>
        </el-col> -->
        </el-row>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button size="small" @click="visible = false">关闭</el-button>
      <el-button size="small" type="primary" v-if="method != 'view'" @click="doSubmit()" v-noMoreClick>确定</el-button>
    </span>
  </el-dialog>
</div>
</template>

<script>
  import CityPicker from '@/components/cityPicker'
  import GridSelect from '@/components/gridSelect'
  export default {
    data () {
      return {
        title: '',
        method: '',
        visible: false,
        loading: false,
        headPortraitArra: [],
        idCardFrondArra: [],
        idCardBackArra: [],
        individualCertificationArra: [],
        inputForm: {
          id: '',
          employmentStatus: '',
          userName: '',
          passWord: '',
          headPortrait: '',
          phone: '',
          email: '',
          realName: '',
          idCard: '',
          idCardFrond: '',
          idCardBack: '',
          gradeRatings: '',
          isApprove: '',
          attstatus: '',
          loginRoot: '',
          individualCertification: '',
          token: '',
          sex: '',
          age: '',
          workingYears: '',
          graduatedSchool: '',
          plusJobsTime: '',
          currentAddress: '',
          numbering: '',
          isDispatch: '',
          rongyunuserid: '',
          rongyuntoken: '',
          department: {
            id: ''
          },
          branchdepart: {
            id: ''
          },
          // 新增的公司
          enterpriseInformation:{
            id: ''
          },
          sendenterprise:{
            id: ''
          },
          job: '',
          openingbank: '',
          banknumber: '',
          bankcard: '',
          workCondition: '',
          emergencyContact: '',
          emergencyContactPhone: '',
          address: '',
          area: '',
          communication: '',
          interview: '',
          collect: '',
          delivery: '',
          terminaId: '',
          householdRegister: '',
          interest: '',
          drivingLicense: '',
          education: '',
          balance: '',
          paymentPassword: '',
          remarks: '',
          telePhone: '',
          individualcertificationvideo: '',
          ismerchantauthentication: ''
        }
      }
    },
    components: {
      CityPicker,
      GridSelect
    },
    methods: {
      init (method, id) {
        this.method = method
        this.inputForm.id = id
        if (method === 'add') {
          this.title = `新建个人端用户信息`
        } else if (method === 'edit') {
          this.title = '修改个人端用户信息'
        } else if (method === 'view') {
          this.title = '查看个人端用户信息'
        }
        this.headPortraitArra = []
        this.idCardFrondArra = []
        this.idCardBackArra = []
        this.individualCertificationArra = []
        this.visible = true
        this.loading = false
        this.$nextTick(() => {
          this.$refs.inputForm.resetFields()
          if (method === 'edit' || method === 'view') { // 修改或者查看
            this.loading = true
            this.$http({
              url: `/dlyrl/hr/userinformation/userInformation/queryById?id=${this.inputForm.id}`,
              method: 'get'
            }).then(({data}) => {
              this.inputForm = this.recover(this.inputForm, data.userInformation)
              this.inputForm.headPortrait.split('|').forEach((item) => {
                if (item.trim().length > 0) {
                  this.headPortraitArra.push({name: decodeURIComponent(item.substring(item.lastIndexOf('/') + 1)), url: item})
                }
              })
              this.inputForm.idCardFrond.split('|').forEach((item) => {
                if (item.trim().length > 0) {
                  this.idCardFrondArra.push({name: decodeURIComponent(item.substring(item.lastIndexOf('/') + 1)), url: item})
                }
              })
              this.inputForm.idCardBack.split('|').forEach((item) => {
                if (item.trim().length > 0) {
                  this.idCardBackArra.push({name: decodeURIComponent(item.substring(item.lastIndexOf('/') + 1)), url: item})
                }
              })
              this.inputForm.individualCertification.split('|').forEach((item) => {
                if (item.trim().length > 0) {
                  this.individualCertificationArra.push({name: decodeURIComponent(item.substring(item.lastIndexOf('/') + 1)), url: item})
                }
              })
              this.loading = false
            })
          }
        })
      },
      // 表单提交
      doSubmit () {
        this.$refs['inputForm'].validate((valid) => {
          if (valid) {
            this.loading = true
            this.$http({
              url: `/dlyrl/hr/userinformation/userInformation/save`,
              method: 'post',
              data: this.inputForm
            }).then(({data}) => {
              this.loading = false
              if (data && data.success) {
                this.visible = false
                this.$message.success(data.msg)
                this.$emit('refreshDataList')
              }
            })
          }
        })
      }
    }
  }
</script>